feat: add bitblasting circuit for BitVec.cpop#12433
feat: add bitblasting circuit for BitVec.cpop#12433hargoniX merged 174 commits intoleanprover:masterfrom
BitVec.cpop#12433Conversation
|
changelog-library |
|
Mathlib CI status (docs):
|
|
Reference manual CI status:
|
bollu
left a comment
There was a problem hiding this comment.
I did a full pass. I've checked for nonterminal simps, naming conventions, and I've asked to move all the casts that occur in the theorem statements to become hypotheses with default arguments (it makes the theorem statement much more sane to read).
src/Std/Tactic/BVDecide/Bitblast/BVExpr/Circuit/Lemmas/Operations/Cpop.lean
Outdated
Show resolved
Hide resolved
src/Std/Tactic/BVDecide/Bitblast/BVExpr/Circuit/Impl/Operations/Cpop.lean
Outdated
Show resolved
Hide resolved
src/Std/Tactic/BVDecide/Bitblast/BVExpr/Circuit/Impl/Operations/Cpop.lean
Outdated
Show resolved
Hide resolved
bollu
left a comment
There was a problem hiding this comment.
Overall LGTM. I left some naming / stylistic questions in the APIs developed in Lemmas and Bitblast. I didn't read over the proofs in the AIG too carefully, I but they look right to me structurally: They have lemmas for denoting each component, and they rewrite away the AIG junk, and finally apply the denotation.
src/Std/Tactic/BVDecide/Bitblast/BVExpr/Circuit/Impl/Operations/Cpop.lean
Outdated
Show resolved
Hide resolved
hargoniX
left a comment
There was a problem hiding this comment.
Looks pretty good now, I think after this round we can merge 👍
src/Std/Tactic/BVDecide/Bitblast/BVExpr/Circuit/Impl/Operations/Cpop.lean
Outdated
Show resolved
Hide resolved
src/Std/Tactic/BVDecide/Bitblast/BVExpr/Circuit/Impl/Operations/Cpop.lean
Outdated
Show resolved
Hide resolved
src/Std/Tactic/BVDecide/Bitblast/BVExpr/Circuit/Impl/Operations/Cpop.lean
Outdated
Show resolved
Hide resolved
src/Std/Tactic/BVDecide/Bitblast/BVExpr/Circuit/Impl/Operations/Cpop.lean
Outdated
Show resolved
Hide resolved
src/Std/Tactic/BVDecide/Bitblast/BVExpr/Circuit/Impl/Operations/Cpop.lean
Outdated
Show resolved
Hide resolved
src/Std/Tactic/BVDecide/Bitblast/BVExpr/Circuit/Impl/Operations/Cpop.lean
Outdated
Show resolved
Hide resolved
src/Std/Tactic/BVDecide/Bitblast/BVExpr/Circuit/Impl/Operations/Cpop.lean
Outdated
Show resolved
Hide resolved
src/Std/Tactic/BVDecide/Bitblast/BVExpr/Circuit/Lemmas/Operations/Cpop.lean
Outdated
Show resolved
Hide resolved
src/Std/Tactic/BVDecide/Bitblast/BVExpr/Circuit/Lemmas/Operations/Cpop.lean
Outdated
Show resolved
Hide resolved
Co-authored-by: Henrik Böving <hargonix@gmail.com>
| let extendedBits := res.vec | ||
| blastCpopTree aig ⟨extendedBits, by omega⟩ | ||
| else if hw' : 0 < w then | ||
| ⟨aig, x⟩ |
There was a problem hiding this comment.
| ⟨aig, x⟩ | |
| ⟨aig, x⟩ |
This PR adds a bitblasting circuit for
BitVec.cpopwith a divide-and-conquer for a parallel-prefix-sum.This is the most efficient circuit we could fine, after comparing with Kernighan's algorithm and with the intuitive addition circuit.